// app.js
import { get } from "./utils/http";
App({
  onShow(){

  },
  onLaunch() {
    get("/api/login-user/info").then(res=>{
      console.log(res);
      this.globalData.isLogin=true;
      this.globalData.userInfo=res.data.data;
      console.log(this.globalData.isLogin)
    })
    // 展示本地存储能力
    const logs = wx.getStorageSync('logs') || []
    logs.unshift(Date.now())
    wx.setStorageSync('logs', logs)

    // 登录
    wx.login({
      success: res => {
        // 发送 res.code 到后台换取 openId, sessionKey, unionId
      }
    })
  },
  globalData: {
    userInfo: null,
    isLogin:false

  }
})
